package com.example.study_manger.repository;

import com.example.study_manger.entity.Organization;
import com.example.study_manger.entity.Role;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface RoleRe extends JpaRepository<Role, Long>, JpaSpecificationExecutor<Role> {
    Page<Role> findAllByOrganization(Organization organization, PageRequest of);

    List<Role> findByOrganization(Organization organization);

    List<Role> findAllByRoleName(String roleName);
}
